Git-Zadig Plugin
git-zadig is a Git plugin with multi-repository collaborative management capabilities, featuring multi-repository management, local code checking, multi-repository commit and Merge Request creation, code change information aggregation, and integration with Zadig workflows for daily iteration validation.
Currently only supports GitLab.

# Administrator Operations
# Prepare Manifest Configuration File
Configure the manifest file
The manifest data structure is completely inherited from Google's git-repo tool, format reference documentation(opens new window)
- Element remote attribute type: Optional, used to specify the remote repository type. When the remote repository is GitLab, specify <remote type="gitlab"/>, which can automatically create MR in the changed repository.
- Element manifest-url: Optional, specifies the repository address where the manifest is located, used for generating commit record link information. If not filled, it will be automatically generated according to the current manifest clone address. When the address is special, the automatic generation may be inaccurate, then manual specification is required.
- Element record-branch: Optional, specifies the branch in the manifest-url repository, used to record MR information created during the multi-repository commit process. Ensure that the configured branch already exists in the manifest-url repository and has push permissions for that branch.
Configuration file example:
Example reference: https://github.com/koderover/zadig/tree/main/examples/git-zadig-demo(opens new window)
<manifest>
<record-branch>change-history</record-branch>
<manifest-url>https://gitlab.com/kr-poc/manifest-repo</manifest-url>
<remote name="origin"
fetch="https://gitlab.com/kr-poc"
review="https://gitlab.com"
type="gitlab"/>
<default revision="main"
remote="origin"
sync-j="4" />
<project path="app-1-repo" name="app-1-repo" />
<project path="app-2-repo" name="app-2-repo" />
</manifest>
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Configure Zadig Workflow
Configure the Zadig workflow according to actual requirements and add corresponding Git triggers, refer to documentation.
- Use git-zadig tool to sync code during the build process

- Configure triggers

Note
- Select the repository where the manifest file is located for the trigger code repository
- The target branch should be consistent with the record-branch element configuration in the manifest file
- Select Push commits for the trigger event
- Configure IM notifications

# Prepare Pre-check Scripts
- Write git hook scripts and commit them to the code repository for unified management, refer to tutorial: git hook tutorial(opens new window)
- Example: https://github.com/koderover/zadig/tree/main/examples/git-hook-demo(opens new window)
# Engineer Operations
# Download and Install git-zadig Tool
- Download the git-zadig tool suitable for your system version on Zadig, as shown in the figure below.

- After extraction, put the git-zadig tool in PATH and add executable permissions.
# Use Case 1: Multi-repository Commit and Trigger Zadig Workflow
# Specific Operations
- Initialize the workspace and download all related repos locally
git zadig init -u <manifest-url> -b <manifest-branch>
git zadig sync
2
- Create a feature branch and start coding
git zadig start --all <branch>
- After completing coding, commit code and execute the upload command
# Execute in each project directory locally
git add .
git commit -m "msg"
# Execute in the workspace
git zadig upload
2
3
4
5
6

Upload Operation Description
- Fill in the necessary MR title and description information
- Remove the comments before the commits that need to be submitted
# Implementation Results
- Manifest repository gets change summary, MR automatically created for changed code repositories.


Get the commit URL of the manifest repository from the output, access the URL to get the summary information of multi-repository code commits, including modified code repositories, feature branches, and corresponding MR information
- Workflow auto-trigger effect


- IM notification effect

# Use Case 2: Add Pre-check Scripts
- Add pre-check scripts for single/multi repositories. The script will automatically identify whether the current working directory belongs to a single repository or multi-repository and initialize accordingly.
git zadig hook -u <hook-url> -b <hook-branch>

- Perform git operations in the current project, you can find that hook checks have been injected.

- Clean up single/multi repository pre-check scripts. The script will automatically identify whether the current workflow directory is single repository or multi-repository.
git zadig hook -c


